import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/singer'
    },
    {
      path: '/recommend',
      component: (resolve) => require(['@/components/recommend/recommend.vue'], resolve)
    },
    {
      path: '/singer',
      component: (resolve) => require(['@/components/singers/singers.vue'], resolve),
      children: [
        {
          path: ':id',
          component: (resolve) => require(['@/components/singer-detail/singer-details.vue'], resolve)
        }
      ]
    },
    {
      path: '/rank',
      component: (resolve) => require(['@/components/rank/rank.vue'], resolve)
    },
    {
      path: '/search',
      component: (resolve) => require(['@/components/search/search.vue'], resolve)
    }
  ]
})
